STCOM-1012: Add initial typescript type declarations#1824
Conversation
|
I'm a typescript noob; please bear with me. Does this change mean we need to keep |
|
Thanks @ncovercash for the initial pass. I do like the developer experience that TS provides along with its friendliness to developers who are accustomed to working in strongly typed languages... but there are some questions about how things are going to work for this and the maintenance and special cases it could entail. All that said, this would be a perfect thing to talk about at a stripes-architecture meeting... @ncovercash - we meet every Thursday at 9AM CST - it would be great to talk about it at that meeting with a handful of stripes devs/module devs from elsewhere in the FOLIO ecosystem. |
|
@JohnC-80 I would love to discuss this at an architecture meeting - is there any particular method for getting something on the agenda for one of these meetings? And @zburke with this method, yes - there are some tools to automatically generate type definitions, however, they would not be able to do anything more than really just adding "this component exists, good luck on anything more". The separate .d.ts type files are mostly a bridge between pure js modules that the typescript compiler can't infer anything about and a fully TS module. This solution is really just a local version of https://github.com/DefinitelyTyped/DefinitelyTyped, a massive repo full of these kinds of type-only definitions. |
With ESCONF-19, this adds TS support for eslint. The specification of parser here is redundant with the parser specified in the central configuration and overrode the typescript parser on .ts files, therefore, was removed to allow the central configuration to have full authority over parsing.
Jira STCOM-1012
This PR adds initial type declarations to this library. These type definitions are effectively meaningless as every export is declared as
any(which can match functions, classes, constants, etc, with no type information). However, they provide a starting point for the remainder of STCOM-1012 as types can now be added incrementally.Please track the Jira ticket to see examples on how these type declarations can be written.